import java.util.ArrayList;
import java.util.List;
import java.util.regex.*;

public class Capturing {
	public static void main(String[] args) {
		String input = "I have a cat, but I like my dog better. Who is he? Must be it! Goose must go on and on and on.";

		Pattern p = Pattern.compile("([A-Z][^\\.^\\?^\\!]+[\\.!?])");
		Matcher m = p.matcher(input);

		List<String> animals = new ArrayList<String>();
		while (m.find()) {
			System.out.println("FOUND [" + m.group() + "]");
			animals.add(m.group());
		}
	}
}